package com.jbh.wanandroidkotlin.activity

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.jbh.wanandroidkotlin.manager.AppActivityManager
import me.imid.swipebacklayout.lib.app.SwipeBackActivity

open class BaseActivity : SwipeBackActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        AppActivityManager.instance.add(this)
    }

    override fun onDestroy() {
        super.onDestroy()
        AppActivityManager.instance.remove(this)
    }

    fun <T> goToActivity(cls:Class<T>){
        startActivity(Intent(this,cls))
    }
}